components/control_panel¶
Control panel widget.
Block network graph and console.
Submodules¶
components/control_panel/block_diagram¶
Block diagram functionality for control panel. Relies on the third-party
library elkjs. Renders being block
diagram to the components/control_panel/control_panel.ControlPanel
widget.
- block_diagram.draw_block_diagram(svg, graph)¶
Draw block diagram graph on SVG. Also prepares the animations inside. Returns an array with all value and message connections. These references can then be used to trigger / steer animations.
- Arguments
svg (
SVGElement()
) – SVG element to draw on.graph (
Object()
) – Block network graph.
- Returns
array – All value and message connections.
components/control_panel/console¶
Console functionality for control panel.
- class Console(list, maxlen=50)¶
Console logic. Feeds new log messages in an associated ul list element. Has block auto scrolling functionality -> Turn off auto scrolling when cursor is over ul list element.
- Arguments
list (
HTMLUListElement()
) – HTML ul list to populate.maxlen (
number()
) – Maximum number of log entries.
- Console.auto_scrolling¶
type: boolean
Check if auto scrolling enabled.
- Console.copy_log_records_to_clipboard()¶
Copy all of the current log messages to the clipboard.
- Console.new_log_message(record)¶
Process new log record.
- Arguments
record (
object()
) – New log record.
- Console.remove_oldest_log()¶
Remove oldest log entry from list.
- Console.scroll_all_the_way_down()¶
Scroll to the bottom.
components/control_panel/control_panel¶
Control panel widget web component.
- class ControlPanel()¶
Control panel web component widget
<being-control-panel>
. Holds block network graph and console, animates connection activity.- ControlPanel.collapse_console()¶
Collapse console list.
- ControlPanel.expand_console()¶
Expand console list.
- ControlPanel.init_html_elements()¶
Initialize HTML elements with shadow dom.
- ControlPanel.new_being_state_message(msg)¶
Process being-state messages. Check for new messages and trigger message connection dot animation.
- Arguments
msg (
Object()
) – Being state message.
- ControlPanel.new_log_message(msg)¶
Process new log message. Relay to console.
- Arguments
msg (
Object()
) – Log message.
- ControlPanel.new_motor_message(msg)¶
Process new motor update messages. These can be of type “motor-update” or “motor-updates” for batch update of all motors.
- Arguments
msg (
Object()
) – Motor update message. Either for a single or multiple motors.
- ControlPanel.set_notification_center(notificationCenter)¶
Associate notification center.
- ControlPanel.set_value_connection_flow(flowing)¶
Set flowing state / animation of value connection.
- Arguments
flowing (
boolean()
) – Flow state true / false
- ControlPanel.update(motors)¶
For new motor infos update widget.
- Arguments
motors (
array()
) – Current motor infos.